<?php

namespace App\Console\Commands;

use App\Console\Commands\Common\CommonCommand;
use App\Mail\NoticeStudent;
use App\Mail\NoticeStudentResult;
use App\Models\Rbac\Permission;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Kkokk\Poster\PosterManager;

class Demo extends CommonCommand {



    public function handle() {

           

        /*$email = '1043068972@qq.com';
        //$email = '530371069@qq.com';
        //$email = 'youmeihaodemingguo@163.com';
        $name = 'hahah';
        $college ='北京大学';
        $reviewTime =date('Y-m-d H:i:s');
        $address ='视频会议';
        Mail::to($email)->send(new NoticeStudent($name,$college,$reviewTime,$address));*/


        /*$src = public_path('/mail/word.jpg');

        $content1 =
            "你好XXX同学：
   恭喜你恩或扥 未发文废物 违反";
        $content2 =
            "wfwef：
   wfwegfrgergegrg";
        $buildTextManyArr  = [
            [
                'content'=> $content1,
                'dst_x' => 10,
                'dst_y' => 100,
                'font' => 26,
                'rgba' => [51, 51, 51, 1],
                'max_w'=> 0,
                'font_family' => '',
                'weight' => 3,
            ],
            [
                'content'=> $content2,
                'dst_x' => 10,
                'dst_y' => 200,
                'font' => 26,
                'rgba' => [255, 0, 0, 1],
                'max_w'=> 0,
                'font_family' => '',
                'weight' => 3,
            ]
        ];

        $result = PosterManager::Poster('../../../../'.time().'.png')
            ->buildImDst($src)
            //->buildImageMany($buildImageManyArr)
            ->buildTextMany($buildTextManyArr)
            ->getPoster();*/

        /*$name = '皮卡丘';
        $college = '麻省理工';
        $reviewTime = date('Y-m-d H:i:s');
        $address = '腾讯会议100-33-333';
        Mail::to('2281965519@qq.com')->send(new NoticeStudent($name,$college,$reviewTime,$address));*/



        /*dd(json_encode([
            ['activity'=>"志愿者",
                'date'=>"2022-10-01",
                'reason'=>"积攒公益时间"
            ],
            ['country'=>"志愿者",
                'date'=>"2022-10-01",
                'reason'=>"积攒公益时间"
            ],
        ],JSON_UNESCAPED_UNICODE));*/


        /*$str =  file_get_contents(public_path('1.txt'));
        $items = explode("\r\n", $str);
        foreach ($items as $item) {
            DB::table('college')->insert(['value'=>$item]);
        }*/

        //dd(generateJWT(['id'=>1,'time'=>time()]));

    }
}
